package org.i1510.common.utils.jdbcTest;



import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class OraclTest {
	public static void main(String[] args) {
		String url = "jdbc:oracle:thin:@192.168.199.240:1521:db1";
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver"); // 建表后先commit才能在其它端中调用

			Connection conn = DriverManager.getConnection(url, "wx_rdo", "joe123#");
			Statement stmt = conn.createStatement(); // 建表时的插入语句记得为' ',而不是" "
			String strSql = "SELECT * FROM datachk.z_salesms_config";// 将sql中将;去掉
			ResultSet rs = stmt.executeQuery(strSql);
			while (rs.next()) {
				// System.out.println("TestID:"+rs.getString(1));
				System.out.println(rs.getObject(1) + "\t" + rs.getObject(2));
				// System.out.println("Describe:"+rs.getString(2));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.exit(0);

	}
}
